/**
 * File:   NodeComparatorByQuality.java
 * Author: Gvennet
 */
package dht.emulator;

import java.io.Serializable;
import java.util.Comparator;

final class NodeComparatorByQuality implements Comparator<Node>, Serializable
{

    @Override
    public int compare(Node o1, Node o2)
    {
        if (o1.getQuality() > o2.getQuality())
        {
            return 1;
        }
        if (o1.getQuality() < o2.getQuality())
        {
            return -1;
        }
        return 0;
    }
}
